<%@ page import="com.lagou.demo03.model.Student" %>
<%@ page import="java.util.List" %>
<%@ page import="com.lagou.demo03.service.ClassStudentQueryService" %>
<%@ page import="com.lagou.demo03.dao.ClassStudentQueryDao" %>
<%@ page import="com.lagou.demo03.dao.ClassStudentQueryDaoImp" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head style="padding:30px;">
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <link rel="stylesheet" href="static/css/bootstrap.min.css">
    <title>该班级的学生</title>
</head>
<body>
<form class="form-inline" action="classStudentQuery" method="post">
    <div class="form-group">
        <input type="text" class="from-control" placeholder="按班级名称查询" id="queryClassStudent" name="queryClassStudent">
    </div>
    <div class="form-group">
        <!-- 新增按钮采用模态框进行班级信息的输入 -->
        <button type="submit" class="btn btn-primary" >查询</button>
    </div>

</form>
<%
    Object query = pageContext.findAttribute("queryClassName");
    String queryClassStudent = (String) query;
    System.out.println("jsp:"+queryClassStudent);
    ClassStudentQueryService classStudentQueryService = new ClassStudentQueryService();
    List<Student> queryClassStudentList = classStudentQueryService.classStudnetQueryService(queryClassStudent);
    System.out.println(queryClassStudentList.size());
%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<table class="table table-responsive">
    <!-- 标题 -->
    <thead>
    <tr>
        <th>序列</th>
        <th>学号</th>
        <th>班级</th>
        <th>姓名</th>
        <th>性别</th>
        <th>出生日期</th>
        <th>邮箱</th>
        <th>备注</th>
    </tr>


    <!-- 信息条目 -->
    <%--    采用jstl的循环标签更新代码--%>
    <%for(Student s : queryClassStudentList){%>
        <!-- 信息条目 -->
        <tr class="info" name="item">
            <td><input type="radio" name="num"></td>
            <td name="userId"><%=s.getId()%></td>
            <td name="userId"><%=s.getCls()%></td>
            <td name="userName"><%=s.getName()%></td>
            <td name="userSex"><%=s.getSex()%></td>
            <td name="userBirthday"><%=s.getBirthday()%></td>
            <td name="userMail"><%=s.getMail()%></td>
            <td name="userNote"><%=s.getNote()%></td>
        </tr>
    <%}%>
</body>
</html>
